<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link
      href="https://cdn.jsdelivr.net/npm/animate.css@3.5.1"
      rel="stylesheet"
      type="text/css"
    />
    <style>
      li {
        width: 100px;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <input v-model="keywords" type="text" />
      <ul>
        <transition-group
          enter-active-class="animated bounceInLeft"
          leave-active-class="animated bounceOutRight"
        >
          <li v-for="filterProduct in filterProducts" :key="filterProduct.name">
            {{ filterProduct.name }}
          </li>
        </transition-group>
      </ul>
    </div>
  </body>
  <script src="./node_modules/vue/dist/vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data() {
        return {
          keywords: '',
          products: [
            {
              name: 'iPhone'
            },
            {
              name: 'ipad'
            },
            {
              name: 'Mac'
            }
          ]
        }
      },
      computed: {
        filterProducts() {
          return this.products.filter((p) => p.name.indexOf(this.keywords) > -1)
        }
      }
    })
  </script>
</html>
